<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>录入分享内容</title>
<link rel="stylesheet" type="text/css" href="../css/base.css" />
<script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script>
<!-- 验证控件 -->
<script src="../js/formValidator/formValidator-4.1.1.js" type="text/javascript" charset="UTF-8"></script>
<script src="../js/formValidator/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<!-- 文本编辑器 -->
<link rel="stylesheet" href="../js/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="../js/kindeditor/plugins/code/prettify.js"></script>
<script type="text/javascript" src="../js/kindeditor/kindeditor-min.js" ></script>
<script type="text/javascript" src="../js/kindeditor/zh_CN.js" ></script>
<!-- date picker 日期控件 -->
<link rel="stylesheet" href="../js/datepicker/datepicker.css" />
<script  type="text/javascript" src="../js/datepicker/bootstrap-datepicker.js"></script>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
	editor = K.create('textarea[name="bookContent.content"]', {
		cssPath : '../js/kindeditor/plugins/code/prettify.css',
		allowFileManager : true,
		width : '470px',
		height : '200px',
		uploadJson : '../kindeditor/upload',
		fileManagerJson : '../kindeditor/manager',
		allowFileManager : true,
		items : [ 'bold', 'italic', 'underline', 'strikethrough', 'removeformat','|','forecolor', 'hilitecolor',  
					 'title', 'fontname', 'fontsize',  '|', 
					 'justifyleft', 'justifycenter', 'justifyright','|', 
					  'emoticons', 'image'
					 ]
	});
	
	editor2 = K.create('textarea[name="bookContent.comment"]', {
		cssPath : '../js/kindeditor/plugins/code/prettify.css',
		allowFileManager : true,
		width : '470px',
		height : '200px',
		uploadJson : '../kindeditor/upload',
		fileManagerJson : '../kindeditor/manager',
		allowFileManager : true,
		items : [ 'bold', 'italic', 'underline', 'strikethrough', 'removeformat','|','forecolor', 'hilitecolor',  
					 'title', 'fontname', 'fontsize',  '|', 
					 'justifyleft', 'justifycenter', 'justifyright','|', 
					  'emoticons', 'image'
					 ]
	});
	//prettyPrint();
});

$(document).ready(function(){
	$.formValidator.initConfig({formID:"form1",theme:"ArrowSolidBox",debug:false,submitOnce:true,
		onError:function(msg,obj,errorlist){
			$("#errorlist").empty();
			$.map(errorlist,function(msg){
				$("#errorlist").append("<li>" + msg + "</li>")
			});
			alert(msg);
		},
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...',
		onShowClass : "",
		onFocusClass : "",
		onCorrectClass : ""
	});
	
	$("#date").formValidator(
			{
			onShow:"指定显示的日期!",
			onFocus:"指定显示的日期"})
		.inputValidator({
			min:1,
			max:100,
			onError:"指定显示的日期!"
			});
	
	
	$("#content").formValidator(
			{
			onShow:"请录入文章的内容！",
			onFocus:"请录入文章的内容！"})
		.inputValidator({
			max:5000,
			onError:"请录入正确的文章内容!"
			});
	
	$("#comment").formValidator(
			{
			onShow:"请录入注解的内容！",
			onFocus:"请录入注解的内容！"})
		.inputValidator({
			max:5000,
			onError:"请录入正确的注解内容!"
			});
	
	$("#date").datepicker({
		format: 'yyyy-mm-dd'
	});
	
});


</script>
</head>

<body>
 <form name="form1" id="form1" action="write.action?op=save" method="post">
	<table>
		<tr>
			<td><span class="title">显示日期：</span></td>
		</tr>
		<tr>
			<td><input type="text" id="date" maxlength="100" name="bookContent.date" value="${today}" /><br />
			</td>
			<td><div id="dateTip" style="width:280px"></div></td>
		</tr>
		<tr>
			<td><span class="title">内容：</span><div id="contentTip" style="width:280px"></div></td>
		</tr>
		<tr>
			<td colspan="2">
			<textarea id="content" class="text" name="bookContent.content" ></textarea>
			</td>
		</tr>
		<tr>
			<td><span class="title">注解：</span><div id="commentTip" style="width:280px"></div></td>
		</tr>
		<tr>
			<td colspan="2">
			<textarea id="comment" class="text" name="bookContent.comment" ></textarea>
			</td>
		</tr>
	</table>		
	<input type="submit" value="提交" />
</form>
</body>
</html>

